// ----------------------------------
// RSDK Project: Sonic Essence
// Script Description: FG Detail
// Script Author: Xanman
// ----------------------------------

// Aliases
private alias 24 : TYPE_FGDETAIL

// Function declarations
reserve function FGDETAIL_DebugDraw
reserve function FGDETAIL_DebugSpawn

function FGDETAIL_DebugDraw
	DrawSprite(0)
end function


function FGDETAIL_DebugSpawn
	CreateTempObject(TypeName[FG Detail], 0, object.xpos, object.ypos)
	object[tempObjectPos].drawOrder = 6
end function


event ObjectMain
	object.priority = PRIORITY_ACTIVE
end event


event ObjectDraw
	if object.propertyvalue >= 5
		DrawSpriteFX(object.propertyvalue, FX_FLIP, object.xpos, object.ypos)
	else
		DrawSpriteFX(object.propertyvalue, FX_ROTOZOOM, object.xpos, object.ypos)
	end if
end event


event ObjectStartup

	LoadSpriteSheet("SSZ/Objects.gif")

	// Ring frames
	
	SpriteFrame(-32, -106, 64, 113, 35, 398) //Palmtree
	SpriteFrame(-8, -33, 24,38, 35, 359) //Flower

	SpriteFrame(-8, -22, 58, 27, 229, 362) //Bush
	SpriteFrame(-8, -22, 48, 30, 288, 359  //Bush 2
	SpriteFrame(-8, -15, 43, 20, 337, 369) //Rock
	SpriteFrame(-8, -31, 33, 34, 381, 355) //Foilage
	SpriteFrame(-8, -31, 33, 34, 415, 355) //Foilage with Flower
	




	// Add the Ring to the debug mode object list
	SetTableValue(TypeName[FG Detail], DebugMode_ObjCount, DebugMode_TypesTable)
	SetTableValue(FGDETAIL_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
	SetTableValue(FGDETAIL_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
	DebugMode_ObjCount++
	
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
